package com.itheima.chap05;

public class PriceDiscountCoupon implements Counpon {
    private int threshold;
    private int discount;

    public PriceDiscountCoupon(int threshold, int discount) {
        this.threshold = threshold;
        this.discount = discount;
    }

    @Override
    public int calculateDiscount(double totalPrice) {
        return totalPrice >= threshold ? discount : 0;     //计算优惠金额
    }
}
